﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Swift;
using CB.Logic;
using DG.Tweening;
using ColorBlock = CB.Logic.ColorBlock;

namespace CB.Client
{
    public class ColorBlockIcon : BlockIcon<ColorBlock>
    {
        public override ColorBlock Block
        {
            get => block;
            set
            {
                block = value as ColorBlock;
                Icon.gameObject.SetActive(block.BColor != BColor.None);
                Icon.material = Resources.Load<Material>($"Render/BlockIcon{block.BColor}");
            }
        }
        private ColorBlock block;

        public override void SetData(ColorBlock block)
        {
            Block = block;
        }
    }
}
